﻿<?xml version="1.0" encoding="UTF-8"?>
<!--RSS generated by Windows SharePoint Services V3 RSS Generator on 7/30/2010 6:14:50 PM-->
<?xml-stylesheet type="text/xsl" href="/Wouter/_layouts/RssXslt.aspx?List=c04a88a9-d138-4ac3-a2bb-b95c9fdd114e" version="1.0"?>
<rss version="2.0">
  <channel>
    <title>Wouter: Posts</title>
    <link>http://blogs.code-counsel.net/Wouter/Lists/Posts/AllPosts.aspx</link>
    <description>RSS feed for the Posts list.</description>
    <lastBuildDate>Fri, 30 Jul 2010 16:14:49 GMT</lastBuildDate>
    <generator>Windows SharePoint Services V3 RSS Generator</generator>
    <ttl>60</ttl>
    <image>
      <title>Wouter: Posts</title>
      <url>/Wouter/_layouts/images/homepage.gif</url>
      <link>http://blogs.code-counsel.net/Wouter/Lists/Posts/AllPosts.aspx</link>
    </image>
    <item>
      <title>About the CKSDEV and Microsoft PowerTools Sandboxed Web Part</title>
      <link>http://blogs.code-counsel.net/Wouter/Lists/Posts/ViewPost.aspx?ID=156</link>
      <description><![CDATA[<div><b>Body:</b> <div class=ExternalClassFB56CA65C3C94A0E92CF89FC2C1F0001>
<p>Early last year I thought it was fun to rise to the challenge of creating a visual (designable) Web Part that could be deployed into the SharePoint 2010 Solution Sandbox. Mostly as a fun programming exercise and also because I wasn't sure how it could be achieved. In the end I got a pretty decent working solution that is now part of <a href="http://cksdev.codeplex.com/">CKSDEV</a>. </p>
<p>A while ago Microsoft also released a set of productivity extensions for the SharePoint sandbox. The PowerTools contain two new features; sandboxed compilation and… a Visual Web Part. Both features are also present in CKSDEV&gt; A duplication which is best avoided. The CKSDEV team quickly decided to drop our versions in favor of Microsofts. Being the author of both features I want to go over the differences between the two and the reasoning behind dropping our features. </p>
<p><em>(Note that we only drop the template needed to create new sandboxed Web Parts, existing code will remain to work) </em></p>
<p><strong>Sandboxed compilation </strong></p>
<p>The motivation for this feature in CKSDEV was to provide additional compile-time information because certain methods are not available in the sandbox and normal compilation still allows you to call the unavailable code. My approach sucks a bit. It is only partly integrated into Visual Studio. When you hit 'Compile for Sandbox' the project references are updated to point to the sandboxed object model, a compile is forced and next the references are put back into place. This means you have to check out the project for this to work, and it modifies your project too. (It did only take a few lines of code though<span style="font-family:Wingdings">J</span>) </p>
<p>The Microsoft approach is integrated much further into the build process of Visual Studio. No fussing with swapping project references. All in all it is a much cleaner model. When you compile it either compiles against the sandbox or it compiles normally, depending on project settings. It also enables the red squiggly lines that appear as you type your code to indicate something will not compile when you would hit F5. This is something that we as the CKSDEV team cannot achieve with the current approach. So, Microsoft's version clearly wins in terms provided level of functionality. Luckily, we only have to remove our button and drop the code. There are no runtime dependencies within your actual projects. </p>
<p><strong>Sandboxed Visual Web Part </strong></p>
<p>This one is a bigger story. Both CKSDEV and the PowerTools provide their own template for creating a Sandboxed Visual Web Part. There is only one similarity in the approach. Both versions have no runtime requirement for including our DLLs. Everything you need is either generated or typed by you, but that is pretty much it. Let me begin with explaining how the CKSDEV version works (which was first to hit the market! They'll never take that away from me <span style="font-family:Wingdings">J</span>). </p>
<p>Basically both approaches parse the ASCX file when you save it, and the generated code is added to your project. That way parsing does not take place at runtime outside of the sandboxed environment. </p>
<p>One of the biggest challenges for CKSDEV was to find a way to parse a User Control (ASCX) file and push the generated code into the project. The ASP.NET User Control parser is hidden from the public so calling it directly is not an option. There are a few ways to work around this issue. The workaround applied by CKSDEV was to call the aspnet_compiler.exe tool with the –debug flag. This forces the code generation to take place, obviously with too details like line pragma's and other unnecessary stuff. We then scoop up the generated code and push the code into the project. The overall code structure resulting from this approach is shown in the following graphic. Blue means generated, green is stuff you type. </p>
<p><img alt="" src="/Wouter/Lists/Photos/070910_1729_AbouttheCKS1.png"> </p>
<p>Lots of blue stuff for little green stuff! </p>
<p>The Microsoft approach to parsing the ASCX is to use the ClientBuildManager class provided by ASP.NET. I also wanted to use this class but getting it to work exactly as I wanted involved lots of CodeDom and more work than I wanted to do. The ClientBuildManager is able to generate code into a CodeDom CodeCompileUnit which you then transform into code using an ICodeGenerator from .NET. This approach is more involved and requires the generated to be buffed and polished. We choose not to learn too much CodeDOM, but obviously that knowledge is already inhouse somewhere in Redmond. The structure is much different though. Since you get back a CodeCompileUnit (basically a parse tree) you can modify the tree to suite your needs. One cool effect the Microsoft approach then has is that your resulting code does not use the UserControl base class but directly creates a Web Part. The benefit is less classes to generate and maintain. The graphic is as follows. </p>
<p><img alt="" src="/Wouter/Lists/Photos/070910_1729_AbouttheCKS2.png"> </p>
<p>The difference for you as a user of the template is primarily visible in the code-behind. For the CKSDEV approach the method that instantiates the generated controls is called automatically by the UserControl base class in the Init phase of the page lifecycle. For the PowerTools edition this method is called by you. Other notable differences is that the CKSDEV approach allows you to use &lt;script runat=&quot;server&quot;&gt; blocks differently from the PowerTools. The reason for this is that the PowerTools use a single class and CKSDEV has a class hierarchy. Say that you use a script block to override the OnLoad method. If you do the same in the code-behind you'll have two methods with the same signature, going in the same class. For the CKSDEV version the OnLoad would be added in a different class and hence you can combine &lt;script runat=&quot;server&quot;&gt; blocks with normal code-behind without thinking about it. </p>
<p><strong>Supporting the CKSDEV Sandboxed Web Part </strong></p>
<p>Given the fact that you may have already invested in the CKSDEV Sandboxed Web Part we are not happy to remove the feature. To ensure that we don't break your build we choose to keep the internal code in place, but we'll remove the Visual Studio template. This means you'll no longer have an easy time creating <span style="text-decoration:underline"><strong><em>new</em></strong></span> CKSDEV Sandboxed Visual Web Parts, but the existing ones will keep on working as is. We do plan to provide a conversion tool to convert the CKSDEV version to the Microsoft version. But given the large differences in the approach there are a few technical difficulties that take a bit of time to overcome. (we'll for instance need to swap out your base class of UserControl in favor of WebPart). One thing that we'll not likely be able to achieve is a conversion tool that will not break existing deployed Web Parts, so there's still some discussing to be done how to handle that. </p>
<p>Hope this clarifies some of the differences between the PowerTools and the CKSDEV version. Of course CKSDEV will continue to provide you with much needed enhancements to the Visual Studio 2010 out of the box experience, these two will just not be part of that). </p>
<p>Did I say you should get <a href="http://cksdev.codeplex.com/">CKSDEV</a> RIGHT NOW! <span style="font-family:Wingdings">J</span> </p></div></div>
<div><b>Published:</b> 7/9/2010 7:29 PM</div>
]]></description>
      <author>Wouter van Vugt</author>
      <pubDate>Fri, 09 Jul 2010 17:29:55 GMT</pubDate>
      <guid isPermaLink="true">http://blogs.code-counsel.net/Wouter/Lists/Posts/ViewPost.aspx?ID=156</guid>
    </item>
    <item>
      <title>Naming your SharePoint accounts</title>
      <link>http://blogs.code-counsel.net/Wouter/Lists/Posts/ViewPost.aspx?ID=155</link>
      <description><![CDATA[<div><b>Body:</b> <div class=ExternalClass7DCD13D7C0A843388DC66C5CCC5BAD4E><p>One of my big focusses when writing software is not to get it to just work, but to get it to work correctly. Hence I spend a ton of time learning about different approaches to solving my SharePoint needs. One area that I focus on in a similar fashion is building my SharePoint VMs. Back in the 2007 days I started building my VMs according to the least privilege principle, e.g. not making everything run under the admin account. Now, if you do that, you must name your service accounts. It suffices to say I take the same level of passion I have on coding approaches to the world of IT Pro stuff. I come across a ton of funky account names that make me wonder how discoverable it all is. Stuff like SPSVCAPP. Right, I cannot even  pronounce it, let alone remember. 
</p><p>So, without further ado, here's my list of account names I typically use when installing SharePoint. Usually I create a separate OU in active directory to group  them, or I use the existing OU when running on 2008R2. Note that this is for SharePoint 2007.
</p><div><table style="border-collapse:collapse" border=0><colgroup><col style="width:142px"><col style="width:198px"><col style="width:161px"></colgroup><tbody valign=top><tr><td style="padding-left:7px;padding-right:7px;border-top:solid #4f81bd 1.0pt;border-left:none;border-bottom:solid #4f81bd 1.0pt;border-right:none"><p><span style="color:#365f91"><strong>Account</strong></span></p></td><td style="padding-left:7px;padding-right:7px;border-top:solid #4f81bd 1.0pt;border-left:none;border-bottom:solid #4f81bd 1.0pt;border-right:none"><p><span style="color:#365f91"><strong>Goal</strong></span></p></td><td style="padding-left:7px;padding-right:7px;border-top:solid #4f81bd 1.0pt;border-left:none;border-bottom:solid #4f81bd 1.0pt;border-right:none"><p><span style="color:#365f91"><strong>Configured when</strong></span></p></td></tr><tr style="background:#d3dfee"><td style="padding-left:7px;padding-right:7px;border-left:none;border-right:none"><p><span style="color:#365f91"><strong>SPSqlService</strong></span></p></td><td style="padding-left:7px;padding-right:7px;border-left:none;border-right:none"><p><span style="color:#365f91">Run SQL Server</span></p></td><td style="padding-left:7px;padding-right:7px;border-left:none;border-right:none"><p><span style="color:#365f91">Installing SQL Server</span></p></td></tr><tr><td style="padding-left:7px;padding-right:7px"><p><span style="color:#365f91"><strong>SPAdminService</strong></span></p></td><td style="padding-left:7px;padding-right:7px"><p><span style="color:#365f91">Run Central Admin</span></p></td><td style="padding-left:7px;padding-right:7px"><p><span style="color:#365f91">Installing SharePoint</span></p></td></tr><tr style="background:#d3dfee"><td style="padding-left:7px;padding-right:7px;border-left:none;border-right:none"><p><span style="color:#365f91"><strong>SPSharedService</strong></span></p></td><td style="padding-left:7px;padding-right:7px;border-left:none;border-right:none"><p><span style="color:#365f91">Run Shared Services</span></p></td><td style="padding-left:7px;padding-right:7px;border-left:none;border-right:none"><p><span style="color:#365f91">Creating the SSP</span></p></td></tr><tr><td style="padding-left:7px;padding-right:7px"><p><span style="color:#365f91"><strong>SPSearchService</strong></span></p></td><td style="padding-left:7px;padding-right:7px"><p><span style="color:#365f91">Run WSS /  MOSS Search</span></p></td><td style="padding-left:7px;padding-right:7px"><p><span style="color:#365f91">Configuring search</span></p></td></tr><tr style="background:#d3dfee"><td style="padding-left:7px;padding-right:7px;border-left:none;border-right:none"><p><span style="color:#365f91"><strong>SPCrawlerService</strong></span></p></td><td style="padding-left:7px;padding-right:7px;border-left:none;border-right:none"><p><span style="color:#365f91">Crawl SharePoint content</span></p></td><td style="padding-left:7px;padding-right:7px;border-left:none;border-right:none"><p><span style="color:#365f91">Configuring search</span></p></td></tr><tr><td style="padding-left:7px;padding-right:7px;border-bottom:solid #4f81bd 1.0pt"><p><span style="color:#365f91"><strong>SPWebService</strong></span></p></td><td style="padding-left:7px;padding-right:7px;border-bottom:solid #4f81bd 1.0pt"><p><span style="color:#365f91">Run content application pools</span></p></td><td style="padding-left:7px;padding-right:7px;border-bottom:solid #4f81bd 1.0pt"><p><span style="color:#365f91">Creating app pools</span></p></td></tr></tbody></table></div><p>As you can see I have a naming convention with the following characteristics:
</p><ul><li>Readable, not just acronyms. Don't make me think rule at play here
</li><li>Prefix with SP. Just to stuff it all together a bit more and to indicate that they are for SharePoint
</li><li>Postfix with Service. Indicate that you should not use these accounts for actual logging in, except for the SPAdminService.
</li></ul><p>Personally I especially like the SPWebService account. You *must* be a SharePoint geek to enjoy that one right? It is the service account that spoons up webs out of the database, hence, SPWebService. Some name it SPWorkerProcess, also fine I'd say.
</p><p>Hope it helps, and have fun naming your accounts. </p></div></div>
<div><b>Published:</b> 7/7/2010 2:06 PM</div>
]]></description>
      <author>Wouter van Vugt</author>
      <pubDate>Wed, 07 Jul 2010 12:06:51 GMT</pubDate>
      <guid isPermaLink="true">http://blogs.code-counsel.net/Wouter/Lists/Posts/ViewPost.aspx?ID=155</guid>
    </item>
    <item>
      <title>Presenting at SharePoint Connections Autumn</title>
      <link>http://blogs.code-counsel.net/Wouter/Lists/Posts/ViewPost.aspx?ID=154</link>
      <description><![CDATA[<div><b>Body:</b> <div class=ExternalClass7F6206E16B89459E90ACD690A04E7097><p><img align=right src="/Wouter/Lists/Photos/061910_1752_Presentinga1.png" alt="">Just got word that my proposal for the <a href="http://www.devconnections.com/shows/NED2010FALL/default.asp?s=157">SharePoint Connections event</a> was accepted. I'll be presenting on the new <a href="http://www.devconnections.com/shows/NED2010FALL/default.asp?c=1&amp;s=157">Access Services capabilities in SharePoint 2010</a> as well as presenting a <a href="http://www.devconnections.com/shows/NED2010FALL/default.asp?c=3&amp;s=157">full day post conference</a> on SharePoint development techniques. Awesome! Personally I was quite amazed to learn how much cool stuff you can build on Access so I am very much looking forward to spreading the news. Many of you perhaps know me as a developer, and as it is with many developers, Access was a loooooong way down the Technologies-I-Would-Use stack, but with the pretty awesome server side presence in SharePoint…..  Next up: post conference. This will be an ideal way for you to pick up on development techniques that are vital to any project, Foundation or Server, small or large. We'll go deep on a bunch of topics, all Foundation features so usable anywhere. Come visit and enjoy learning SharePoint even better! 
</p></div></div>
<div><b>Published:</b> 6/19/2010 7:52 PM</div>
]]></description>
      <author>Wouter van Vugt</author>
      <pubDate>Sat, 19 Jun 2010 17:52:27 GMT</pubDate>
      <guid isPermaLink="true">http://blogs.code-counsel.net/Wouter/Lists/Posts/ViewPost.aspx?ID=154</guid>
    </item>
  </channel>
</rss>